# -*- coding: utf-8 -*-
import scrapy
from ..items import ImagespiderItem


class ImgspiderSpider(scrapy.Spider):
    name = 'ImgSpider'
    allowed_domains = ['lab.scrapyd.cn']
    start_urls = ['http://lab.scrapyd.cn/archives/55.html']

    def parse(self, response):
        item = ImagespiderItem()
        img_urls = response.xpath('//div[contains(@class,"post-content")]/p/img/@src').extract()
        # print('Look Here: ', len(img_urls))
        item['img_url'] = img_urls
        yield item
